<template>
  <div class="dialog-background" v-if="show">
    <div class="dialog-content">
      <div class="flex-wrap flex-center-wrap">
        <zl-icon icon="icon-tishi" :icon-style="allStyle"></zl-icon>
        <div class="dialog-content-title">
          提示
        </div>
      </div>
      <div class="sign-dialog-close">
        <i class="el-icon-close" @click="closeDialog"></i>
      </div>
      <div class="dialog-content-body">
        亲爱的学员，您购买的《{{ productName }}》还未签署协议，为了保障您的学习权益，请签署协议后开始学习。
      </div>
      <div class="dialog-content-footer">
        <button class="dialog-btn" @click="goToSign">
          去签署
        </button>
      </div>
    </div>
  </div>
</template>
<script>
import zlIcon from '@/components/zlIcon.vue'
export default {
  name: 'zlAgreementReminder',
  components: {
    zlIcon
  },
  props: {
    show: {
      type: Boolean,
      default: false
    },
    productName: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      allStyle: {
        width: '18px',
        height: '18px',
        color: '#FFA347',
        marginRight: '10px',
        marginTop: '2px'
      }
    }
  },
  methods: {
    closeDialog() {
      this.$emit('update:show', false)
    },
    goToSign() {
      this.$emit('confirm')
    }
  }
}
</script>
<style scoped>
.dialog-content {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 400px;
  height: 214px;
  background: #ffffff;
  border-radius: 2px;
  padding: 20px 0 20px 20px;
  border-radius: 12px;
}
.dialog-content-title {
  font-size: 18px;
  font-weight: bold;
  color: #1a2840;
  line-height: 16px;
}
.dialog-content-body {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 400;
  color: #667080;
  line-height: 20px;
  padding-right: 28px;
  margin-left: 28px;
}
.dialog-content-footer {
  position: absolute;
  bottom: 20px;
  right: 20px;
  overflow: hidden;
}
.dialog-btn {
  width: 86px;
  height: 32px;
  background: #3480ff;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  color: #ffffff;
  margin: 0 auto;
  line-height: 32px;
}

.dialog-background {
  z-index: 1000;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}
.esign {
  max-width: 1000px;
  margin: auto;
  padding: 10px;
}

.esigh-btns {
  width: 348px;
  height: 40px;
  margin: auto;
  margin-top: 48px;
  margin-bottom: 32px;
}
.sign-btn {
  width: 162px !important;
  height: 40px !important;
  padding: 0 !important;
  cursor: pointer;
}
.sign-btn-clean {
  border-radius: 4px;
  border: 1px solid #e7e7e7;
  margin-right: 24px !important;
  font-size: 14px;
  font-weight: 500;
  color: #8c8c8c;
  line-height: 16px;
  box-sizing: border-box;
}
.sign-btn-confirm {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  line-height: 16px;
  background: #ffaa00;
  border-radius: 4px;
}
.esigh-result {
  margin-top: 10px;
  box-sizing: border-box;
}
.esignature {
  margin: 30px 0;
  border: 2px solid #ccc;
  background-color: #f2f2f2 !important;
}
.viewerContainer::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.viewerContainer {
  height: 100%;
  width: 100%;
}

.esign-box {
  width: 772px;
  box-sizing: border-box;
  height: 360px;
  margin: auto;
}
.sign-background {
  width: 100%;
  background-color: rgb(255, 255, 255);
}
.sign-background-body {
  width: 800px;
  margin: 0 auto;
}
.pdf-review {
  width: 800px;
  height: 100%;
  z-index: 1001;
  background-color: rgb(255, 255, 255);
}
.pdf-box {
  width: 800px;
  height: calc(100% - 173px);
  box-sizing: border-box;
  margin: auto;
}
.pdf-back {
  font-weight: 400;
  width: 800px;
  margin: auto;
  margin-top: 16px;
  margin-bottom: 16px;
  height: 16px;
  font-size: 14px;
  font-weight: 400;
  color: #999;
  line-height: 16px;
  cursor: pointer;
}
.pdf-title {
  height: 91px;
  box-sizing: border-box;
  font-size: 22px;
  font-weight: bold;
  width: 800px;
  color: #262626;
  line-height: 27px;
  padding-top: 54px;
}
.pdf-title-next {
  margin-bottom: 101px;
  font-weight: bold;
  font-size: 22px;
  color: #262626;
}
.read-pdf {
  width: auto;
  height: 100%;
  z-index: 1000;
  overflow: auto;
  border: 1px solid #f0f0f0;
  box-sizing: border-box;
}
.read-pdf img {
  width: 800px;
  height: auto;
}
.sign-btn {
  width: 197px;
  height: 40px;
  border-radius: 4px;
  border: none;
  margin: auto;
  z-index: 1001;
}
.pageContainer {
  margin: auto;
  /* border: 1px solid #F0F0F0 ; */
}
.pageNum {
  display: none !important;
}
.sign-btn-box {
  width: 197px;
  height: 82px;
  box-sizing: border-box;
  padding-top: 12px;
  margin: 0 auto;
}
.sign-note {
  width: 772px;
  height: 42px;
  font-size: 14px;
  font-weight: 400;
  color: #999;
  line-height: 21px;
  margin: auto;
  margin-top: 24px;
}
.sign-dialog-close {
  font-size: 18px;
  font-weight: bolder;
  width: 20px;
  height: 20px;
  position: absolute;
  top: 18px;
  right: 12px;
  line-height: 16px;
  color: #979797;
  cursor: pointer;
}
</style>
